home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Paint v7.1
/
Cloanto Personal Paint v7.1.iso
/
rexx
/
animtoframes.pprx
< prev
next >
Wrap
Text File
|
1997-05-06
|
4KB
|
129 lines
/* Personal Paint Amiga Rexx script - Copyright ⌐ 1995-1997 Cloanto Italia srl */
/* $VER: AnimToFrames.pprx 1.1 */
/** ENG
This script converts the current animation into separate frames, creating
a file for each frame. A three-digit suffix after the user-specified
file name indicates the position of each frame in the animation, starting
from frame 1. For example, if the name "Animation" is selected, the first
frame will be saved as "Animation.001".
*/
/** DEU
Dieses Skript wandelt die aktuelle Animation in Einzelbilder um, wobei
fⁿr jedes Bild eine eigene Datei erstellt wird. Die Position eines
Bildes innerhalb der Gesamtanimation wird durch eine dreistellige
Dateiendung wiedergegeben, beginnend mit Bild 1. Beispiel: Wird als
Name "Animation" festgelegt, so erhΣlt das als erstes gespeicherte
Einzelbild den Dateinamen "Animation.001".
*/
/** ITA
Questo script suddivide l'animazione attuale nei suoi singoli fotogrammi,
creando un file per ciascun fotogramma. Un suffisso a tre cifre presente
dopo il nome specificato dall'utente indica la posizione di ciascun
fotogramma all'interno dell'animazione, iniziando dal fotogramma 1. Ad
esempio, se si sceglie il nome "Animazione", il primo fotogramma sarα salvato
come "Animazione.001".
*/
IF ARG(1, EXISTS) THEN
PARSE ARG PPPORT
ELSE
PPPORT = 'PPAINT'
IF ~SHOW('P', PPPORT) THEN DO
IF EXISTS('PPaint:PPaint') THEN DO
ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
DO 30 WHILE ~SHOW('P',PPPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "Personal Paint could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', PPPORT) THEN DO
SAY 'Personal Paint Rexx port could not be opened'
EXIT 10
END
ADDRESS VALUE PPPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
Get 'LANG'
IF RESULT = 1 THEN DO /* Deutsch */
txt_req_load = 'Animation auswΣhlen'
txt_req_sel = 'Format und Namensstamm auswΣhlen'
txt_err_abort = 'Speichervorgang wurde abgebrochen'
txt_err_save = 'Fehler beim Speichern: '
txt_err_oldclient = 'Fⁿr dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
END
ELSE IF RESULT = 2 THEN DO /* Italiano */
txt_req_load = 'Selezionare animazione'
txt_req_sel = 'Selezionare formato e nome'
txt_err_abort = 'Operazione annullata'
txt_err_save = 'Errore nella scrittura: '
txt_err_oldclient = 'Questa procedura richiede_una versione pi∙ recente_di Personal Paint'
END
ELSE DO /* English */
txt_req_load = 'Select Animation'
txt_req_sel = 'Select Format and Root Name'
txt_err_abort = 'User abort during save'
txt_err_save = 'Error during save: '
txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
END
Version 'REXX'
IF RESULT < 7 THEN DO
RequestNotify 'PROMPT "'txt_err_oldclient'"'
EXIT 10
END
LockGUI
GetFrames
frames = RESULT
IF frames = 0 THEN DO
RequestFile '"'txt_req_load'"'
IF RC = 0 THEN DO
LoadAnimation RESULT 'NEW'
GetFrames
frames = RESULT
END
END
IF frames > 0 THEN DO
RequestFile '"'txt_req_sel'" SAVEMODE LISTFORMATS FORCE'
IF RC = 0 THEN DO
savedata = RESULT
endf = INDEX(savedata, '"', 2)
filename = SUBSTR(savedata, 2, endf - 2)
filedata = SUBSTR(savedata, endf + 1)
GetFramePosition
savepos = RESULT
errcode = 0
SetFramePosition 1
DO fnum = 1 TO frames
fname = filename || "." || RIGHT(fnum, 3, "0")
SaveImage '"'fname'"'filedata 'FORCE QUIET'
IF RC ~= 0 THEN DO
IF RC = 5 THEN
errmess = txt_err_abort
ELSE
errmess = txt_err_save || RC
errcode = RC
LEAVE
END
SetFramePosition 'NEXT'
END
SetFramePosition savepos
IF errcode > 0 THEN
RequestNotify 'PROMPT "'errmess'"'
END
END
UnlockGUI